#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>



int main()
{
	int N = 0;
	scanf("%d", &N);
	char arr[32] = { 0 };
	int count = 0;
	int i = 0;

	while (N)
	{
		if (count % 3 == 0 && count != 0)
		{
			arr[i++] = ',';
		}
		arr[i++] = N % 10 ;
		N = N / 10;
		count++;
	}

	while (i--, i >= 0)
	{
		printf("%d", arr[i]);
	}
	
	return 0;
}